package com.youi.service.impl;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.youi.common.Common;
import com.youi.common.DelStatus;
import com.youi.dao.ProvincecodeDao;
import com.youi.entity.Provincecode;
import com.youi.service.ProvincecodeService;

@Service
public class ProvincecodeServiceImpl extends BaseServiceImpl<Provincecode> implements ProvincecodeService{
		
		private ProvincecodeDao provincecodeDao;
		
		@Autowired
		public void setfaultRecordDao(ProvincecodeDao provincecodeDao){
			this.provincecodeDao=provincecodeDao;
			super.setBaseDAO(provincecodeDao);
		}

		@Override
		public String getProvincecodeByName(String province) {
			// TODO Auto-generated method stub
			Map<String, Object> prams=new HashMap<String, Object>();
			prams.put(Common.DELSTATUS, DelStatus.NODEL);
			prams.put("name", province);
			Provincecode provincecode=provincecodeDao.getObject(prams);
			if (provincecode!=null) {
				return provincecode.getCode();
			}
			return null;
		}
}